
/* Replication material for:
Schoen, Harald. 2010. Die B�rger ziehen Bilanz. Einstellungen zur Gro�en 
Koalition und Wahlverhalten 2009, in: Egle, Christoph/Zohlnh�fer, Reimut 
(Hrsg.), Die zweite Gro�e Koalition, Wiesbaden: VS Verlag f�r 
Sozialwissenschaften, 2010, 29-50.
*/


clear
set mem 400000
use ZA5337.dta		//GLES 2009 Langfrist-Online-Tracking T4
					//ZA-Nummer: 5337
					
*---------------------------------------------
* Operationalization
*---------------------------------------------

* Party Identification
tab a36

gen cdupid=0
replace cdupid=1 if a36==1
gen spdpid=0
replace spdpid=1 if a36==4
gen fdppid=0
replace fdppid=1 if a36==5
gen grupid=0
replace grupid=1 if a36==6
gen pdspid=0
replace pdspid=1 if a36==7
gen nopid=0
replace nopid=1 if a36==89
tab1 cdupid spdpid

gen pid1=0 if a36>0 & a36<100
replace pid1=1 if a36>0 & a36<7
tab pid1


* Evaluations of Politicians
tab1 a27a-a27g
mvdecode a27a-a27g, mv(0 12 98 99)
tab1 a27a-a27g

gen merkel=(a27a-1)/10
gen stein=(a27b-1)/10
gen gutten=(a27c-1)/10
gen wester=(a27d-1)/10
gen k�nast=(a27e-1)/10
gen lafo=(a27f-1)/10
gen gysi=(a27g-1)/10

mean merkel-gysi
mean merkel-gysi, over (a36)
mean merkel-gysi,over(a08b)


* Evaluation of federal government and its constituent parties
tab1 a13-a14c
mvdecode a13-a14c, mv(99)
gen bureg=(a13-1)/10 if a13>0
gen cdu_br=(a14a-1)/10 if a14a>0 
gen csu_br=(a14b-1)/10 if a14b>0
gen spd_br=(a14c-1)/10 if a14c>0
tab1 bureg

corr bureg-spd_br 
corr bureg-spd_br merkel-gysi


* Vote Intention
tab a08b
gen wabs=0 if a07==4 |a07==5
replace wabs=1 if a08b==1
replace wabs=2 if a08b==2
replace wabs=3 if a08b==3|a08b==4|a08b==5
tab wabs

gen wahl=a08b if a08b>0 & a08b<8
tab wahl

gen wahl2=a08b if a08b>0 & a08b<8
replace wahl2=0 if a07==4 |a07==5 |a08b==98
tab wahl2

gen cduvot=0 if wabs>-1 |a08b==9
replace cduvot=1 if wabs==1
gen spdvot=0 if wabs>-1 |a08b==9
replace spdvot=1 if wabs==2
tab1 cduvot spdvot


* Competency
gen cdukom1=0
replace cdukom1=1 if a04==1
gen spdkom1=0
replace spdkom1=1 if a04==4
gen fdpkom1=0
replace fdpkom1=1 if a04==5
gen grukom1=0
replace grukom1=1 if a04==6
gen pdskom1=0
replace pdskom1=1 if a04==7
gen cdukom2=0
replace cdukom2=1 if a06==1
gen spdkom2=0
replace spdkom2=1 if a06==4
gen fdpkom2=0
replace fdpkom2=1 if a06==5
gen grukom2=0
replace grukom2=1 if a06==6
gen pdskom2=0
replace pdskom2=1 if a06==7
gen cdukom=cdukom1+cdukom2
gen spdkom=spdkom1+spdkom2
gen fdpkom=fdpkom1+fdpkom2
gen grukom=grukom1+grukom2
gen pdskom=pdskom1+pdskom2


* Competency of coalitions
tab1 k13 k14


* Soziodemographics
tab1 v_03 v_01 v_02


* Federal State (Residence)
tab a45
gen wo=0 if a45==1
replace wo=1 if a45==2
tab wo


* Left-Right Ego-Placement
tab a33
gen lr=(a33-1)/10 if a33<12
tab lr


* Vote Switching
tab a11b
gen ww1=0 if a11b>0 & a11b<6 & a08b>0 & a08b<6
replace ww1=1 if a11b>0 & a11b<6 & a08b>0 & a08b<6 & a11b~=a08b
tab ww1


* Education
gen sex= v_01-1
gen age=v_02
gen educ=1-(v_03-1)/2 if v_03<4
tab a51s
gen alter=2009-a51s if a51s>1900
tab alter


* Satisfaction with government
tab a13
gen bureg=(a13-1)/10
tab bureg


* Grand Coalition
mean bureg cdu_br csu_br spd_br

mean spd_br spdsym, over (spdpid)
mean cdu_br cdusym, over (cdupid)
mean csu_br csusym, over (cdupid)
mean bureg, over (a36)


* Gridlock in Grand Coalition
mvdecode k26, mv (99)
tab1 k26 k27
gen block=(k26-1)/4 if k26>0

tab block  

mean block [pweight=gew1_t4], over (a36)
tab k27
tab k27 a36 if k27<5

tab K22
gen gk_eval=(K22-1)/4 if K22<6
gen gk_l�s=(K23-1)/4 if K23<6
tab1 gk_eval gk_l�s

mean gk_eval [pweight=gew1_t4], over (a36)
mean gk_l�s [pweight=gew1_t4], over (a36)


* Influence in Grand Coalition
tab k24a
tab k24a a36 [aweight=gew1_t4] if k24a<99, col
tab k24b a36 [aweight=gew1_t4], col

tab k25aa a36 if k25aa<99 [aweight=gew1_t4], col
tab k25ab a36 if k25ab<99 [aweight=gew1_t4], col
tab k25ac a36 if k25ac<99 [aweight=gew1_t4], col
tab k25ad a36 if k25ad<99 [aweight=gew1_t4], col
tab k25ae a36 if k25ae<99 [aweight=gew1_t4], col
tab k25af a36 if k25af<99 [aweight=gew1_t4], col
tab k25ag a36 if k25ag<99 [aweight=gew1_t4], col
tab k25ah a36 if k25ah<99 [aweight=gew1_t4], col
tab k25ai a36 if k25ai<99 [aweight=gew1_t4], col
tab k25aj a36 if k25aj<99 [aweight=gew1_t4], col
tab k25ak a36 if k25ak<99 [aweight=gew1_t4], col


* Prospective Evaluation of Coalitions
tab k1c
gen gk_pro=(k1c-1)/10 if k1c>0 & k1c<12
tab gk_pro

mean gk_pro, over(a36)
corr gk_pro bureg


* Problemsolving Competency of Coalitions
tab1 k13 k14


*----------------------------------------------------------
* Analysis
*----------------------------------------------------------

* Mean and ANOVA-Analysis
mean bureg
mean bureg if a36<10, over (a36)
anova bureg a36 if a36<90, regress nocons

mean cdu_br 
anova cdu_br a36 if a36<90, regress nocons
mean csu_br 
anova csu_br a36 if a36<90, regress nocons
mean spd_br 
anova spd_br a36 if a36<90, regress nocons
mean gk_eval 
anova gk_eval a36 if a36<90, regress nocons
mean gk_l�s 
anova gk_l�s a36 if a36<90, regress nocons

corr block gk_eval
corr block gk_l�s

alpha gk_eval gk_l�s

gen gk_ges=(gk_eval+gk_l�s)/2
tab gk_ges


* Regression Analysis
gen include=1 if merkel>-1 & merkel<2 & stein>-1 & stein<2 & cdukom>-1 ///
	& cdukom<3 & spdkom>-1 & spdkom<3
tab include

mlogit wahl2 cdupid spdpid nopid lr merkel stein wester k�nast lafo cdukom spdkom gk_ges
outreg2 using "C:\Schoen\Wahl2009\results_fin2.txt", bdec(2) 2aster replace

mlogit wahl2 cdupid spdpid nopid lr wester k�nast lafo gk_ges if include==1
outreg2 using "C:\Schoen\Wahl2009\results_fin2.txt", bdec(2) 2aster 

prgen gk_ges, x(cdupid=0 spdpid=0 nopid==1) gen (gk_var7) ci
prgen gk_ges, x(cdupid=0 spdpid=1 nopid==0) gen (gk_var5) ci
prgen gk_ges, x(cdupid=1 spdpid=0 nopid==0) gen (gk_var6) ci

prgen gk_eval, x(cdupid=0 spdpid=0 nopid==1) gen (gk_var1) ci
prgen gk_eval, x(cdupid=0 spdpid=1 nopid==0) gen (gk_var2) ci
prgen gk_eval, x(cdupid=1 spdpid=0 nopid==0) gen (gk_var3) ci


* Vote switch away from SPD
gen spd_swi1=1 if a11b==4
replace spd_swi1=0 if a11b==4 & a08b~=4
tab spd_swi1
gen cdu_swi1=1 if a11b==1
replace cdu_swi1=0 if a11b==1 & a08b~=1
tab cdu_swi1

logit spd_swi1 spdpid lr merkel stein wester lafo k�nast cdukom spdkom gk_eval

logit spd_swi1 spdpid lr merkel stein wester lafo k�nast cdukom spdkom bureg

logit spd_swi1 spdpid lr merkel stein wester lafo k�nast cdukom spdkom gk_ges
outreg2 using "switch_fin4.txt", bdec(2) 2aster

logit spd_swi1 spdpid lr wester lafo k�nast gk_ges if include==1
outreg2 using "switch_fin4.txt", bdec(2) 2aster


* Vote switch away from Christian Democratic Union (CDU/CSU)
tabulate a11b a08b, sum (gk_l�s)

logit cdu_swi1 cdupid lr merkel stein wester lafo k�nast cdukom spdkom gk_eval

logit cdu_swi1 cdupid lr merkel stein wester lafo k�nast cdukom spdkom bureg

logit cdu_swi1 cdupid lr merkel stein wester lafo k�nast cdukom spdkom gk_ges
outreg2 using "switch_fin4.txt", bdec(2) 2aster

logit cdu_swi1 cdupid lr wester lafo k�nast gk_ges if include==1
outreg2 using "switch_fin4.txt", bdec(2) 2aster

prgen gk_ges, x(cdupid=0) gen (gk_var4) ci
prgen gk_ges, x(cdupid=1) gen (gk_var5) ci



